package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.javapracticaltraining.entity.BaseData;
import java.util.Date;
import lombok.Data;

/**
 * 老人膳食记录表
 * @TableName elderly_diet_record
 */
@TableName(value ="elderly_diet_record")
@Data
public class ElderlyDietRecord implements BaseData {
    /**
     * 
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    /**
     * 老人ID
     */
    @TableField(value = "elderly_id")
    private Integer elderlyId;

    /**
     * 用餐日期
     */
    @TableField(value = "meal_date")
    private Date mealDate;

    /**
     * 餐次类型
     */
    @TableField(value = "meal_type")
    private Object mealType;

    /**
     * 食谱ID
     */
    @TableField(value = "recipe_id")
    private Integer recipeId;

    /**
     * 进食状态
     */
    @TableField(value = "intake_status")
    private Object intakeStatus;

    /**
     * 进食百分比
     */
    @TableField(value = "intake_percentage")
    private Integer intakePercentage;

    /**
     * 反馈意见
     */
    @TableField(value = "feedback")
    private String feedback;

    /**
     * 记录人ID
     */
    @TableField(value = "recorder_id")
    private Integer recorderId;

    /**
     * 记录时间
     */
    @TableField(value = "record_time")
    private Date recordTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ElderlyDietRecord other = (ElderlyDietRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getMealDate() == null ? other.getMealDate() == null : this.getMealDate().equals(other.getMealDate()))
            && (this.getMealType() == null ? other.getMealType() == null : this.getMealType().equals(other.getMealType()))
            && (this.getRecipeId() == null ? other.getRecipeId() == null : this.getRecipeId().equals(other.getRecipeId()))
            && (this.getIntakeStatus() == null ? other.getIntakeStatus() == null : this.getIntakeStatus().equals(other.getIntakeStatus()))
            && (this.getIntakePercentage() == null ? other.getIntakePercentage() == null : this.getIntakePercentage().equals(other.getIntakePercentage()))
            && (this.getFeedback() == null ? other.getFeedback() == null : this.getFeedback().equals(other.getFeedback()))
            && (this.getRecorderId() == null ? other.getRecorderId() == null : this.getRecorderId().equals(other.getRecorderId()))
            && (this.getRecordTime() == null ? other.getRecordTime() == null : this.getRecordTime().equals(other.getRecordTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getMealDate() == null) ? 0 : getMealDate().hashCode());
        result = prime * result + ((getMealType() == null) ? 0 : getMealType().hashCode());
        result = prime * result + ((getRecipeId() == null) ? 0 : getRecipeId().hashCode());
        result = prime * result + ((getIntakeStatus() == null) ? 0 : getIntakeStatus().hashCode());
        result = prime * result + ((getIntakePercentage() == null) ? 0 : getIntakePercentage().hashCode());
        result = prime * result + ((getFeedback() == null) ? 0 : getFeedback().hashCode());
        result = prime * result + ((getRecorderId() == null) ? 0 : getRecorderId().hashCode());
        result = prime * result + ((getRecordTime() == null) ? 0 : getRecordTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", mealDate=").append(mealDate);
        sb.append(", mealType=").append(mealType);
        sb.append(", recipeId=").append(recipeId);
        sb.append(", intakeStatus=").append(intakeStatus);
        sb.append(", intakePercentage=").append(intakePercentage);
        sb.append(", feedback=").append(feedback);
        sb.append(", recorderId=").append(recorderId);
        sb.append(", recordTime=").append(recordTime);
        sb.append("]");
        return sb.toString();
    }
}